<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('banners', function (Blueprint $table) {
            $table->id();
            $table->string('image')->comment('图片地址');
            $table->unsignedInteger('sort')->comment('排序');
            $table->unsignedTinyInteger('type')->comment('0=外部，1=内部');
            $table->string('url')->default('/')->comment('跳转路径');
            $table->string('appid')->nullable()->comment('外部appid');
            $table->string('path')->nullable()->comment('外部path');
            $table->unsignedTinyInteger('state')->default(0)->comment('0=关闭，1=开启');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('banners');
    }
};
